#include<iostream>
using namespace std;

void move(char src, char des)
{
    cout<<src<<"-->"<<des<<endl;
}

void hanoi(int n, char src, char med, char des)
{
    if(n == 1)
    move(src, des);
    else
    {
    hanoi(n - 1, src, des, med);
    move(src, des);
    hanoi(n - 1, med, src, des);
    }
}

int main()
{
    int n;
    cout<<"输入层数n"<<endl;
    cin>>n;
    hanoi(n,'A', 'B', 'C');
    return 0;
}